//
//  GHAboutUsViewController.m
//  GodHorses
//
//  Created by Mac on 2017/11/16.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "STDidRealNameViewController.h"
@interface STDidRealNameViewController ()
@property(nonatomic, strong) NSArray<STTableEasyModel*>                     *datasouce;
@end

@implementation STDidRealNameViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"已实名认证";
    [self configSubView];
    

    NSString * realName = self.userModel.realname;
    NSString * idcard = self.userModel.idcard.description;
    
    self.datasouce = @[
//                       [[STTableEasyModel alloc] initWithTextString:@"国际"
//                                                       detailString:@"中国" accessoryType:UITableViewCellAccessoryNone],
                       [[STTableEasyModel alloc] initWithTextString:@"真实姓名" detailString:realName],
                       [[STTableEasyModel alloc] initWithTextString:@"证件类型" detailString:@"身份证"],
                       [[STTableEasyModel alloc] initWithTextString:@"证件号码"
                                                       detailString:idcard accessoryType:UITableViewCellAccessoryNone],
                       
//                       [[STTableEasyModel alloc] initWithTextString:@"证件照片"
//                                                       detailString:@"已完善" accessoryType:UITableViewCellAccessoryNone]
                       ];
    // Do any additional setup after loading the view.
}
#pragma mark --subView
- (void)configSubView{
    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 190)];
    header.backgroundColor = self.tableView.backgroundColor;
    
    UIImageView * logImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 35, 80, 80)];
    logImageView.clipsToBounds = YES;
    logImageView.layer.cornerRadius = 5;
    logImageView.st_centerX = UIScreenWidth / 2;
    logImageView.image = [UIImage imageNamed:@"消息头像"];
    //    logImageView.backgroundColor = [UIColor colorWithRed:55/255.0 green:60/255.0 blue:156/255.0 alpha:1];
    [logImageView sd_setImageWithURL:[NSURL URLWithString:self.userModel.head]];
    [header addSubview:logImageView];
    
   // NSString * nickname = self.userModel.nickname;
    NSString * phone = self.userModel.mobile;
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(0, logImageView.st_bottom + 5, 120, 18)
                                                     text:[NSString stringWithFormat:@"%@\n%@",self.userModel.nickname,phone]
                                                textColor:TM_secendTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    titleLable.st_centerX = UIScreenWidth / 2;
    titleLable.numberOfLines = 0;
    [NSString lableAutoAdjustheightWithLabel:titleLable];
    [header addSubview:titleLable];
  //  self.tableView.tableHeaderView = header;
}
#pragma --mark UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.datasouce.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 44;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 0.01;
}
- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return [UIView new];
}
- (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    return [UIView new];
}
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString * reuseIdentifier =  @"cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
        
    }
    cell.textLabel.textColor = UIColorFromRGBA(0x333333);
    cell.textLabel.font = [UIFont systemFontOfSize:14];
    cell.detailTextLabel.font = [UIFont systemFontOfSize:13];
    cell.detailTextLabel.textColor = UIColorFromRGBA(0x999999);
    STTableEasyModel * model = self.datasouce[indexPath.row];
    cell.textLabel.text = model.textString;
    cell.detailTextLabel.text = model.detailString;
    if (model.accessoryView) {
        cell.accessoryView = model.accessoryView;
    }else{
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    return cell;
}
#pragma --mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    

    [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
}


@end



